package day1.zy2;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        Gongshi g =new Gongshi();
        g.mc="合肥";
        g.mc="小螺号";
        g.fw="洗脚";
        g.hm="12345667";
        int choice=0;
        while (true){
            System.out.println("1,添加员工，2，输出员工信息，3辞退员工，4涨工资，5查找最大年龄的员工，6退出");
            choice=in.nextInt();
            if (choice==1){
                Yuangong yu =new Yuangong();
                System.out.println("请输入姓名");
                yu.setName(in.next());
                System.out.println("请输入年龄");
                yu.setAge(in.nextInt());
                System.out.println("请输入性别");
                yu.setSex( in.next());;
                System.out.println("职务");
                yu.setZhiwu(in.next());
                System.out.println("薪水");
                yu.setXinshui(in.nextInt());
                System.out.println("工号");
                yu.setGonghao(in.next());
                g.add(yu);

            }else if (choice==2){
                g.show();
            }else if (choice==3){
                System.out.println("输入辞退员工姓名");
                String name=in.next();
                boolean b= g.fire(name);
                System.out.println(b?"删除成功":"查无此人");
            }else if (choice==4){
                System.out.println("输入员工姓名");
                String name = in.next();
                //g.addMoney(name);
            }else if (choice==5){
                g.old();
            }
            else if (choice==6){
                break;
            }
        }
        System.out.println("退出了");
    }
}
